package com.chq.demo.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chq.demo.mapper.UserMapper;
import com.chq.demo.model.admin.user.UserModel;
import com.chq.demo.service.admin.UserService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 用户管理
 *
 * @author chenghongqiang
 * @date 2020-10-23 10:33
 * @since 1.0
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, UserModel> implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public UserModel selectByUserName(String userName) {
        QueryWrapper<UserModel> wrapper = new QueryWrapper();
        wrapper.eq("username", userName);
        return userMapper.selectOne(wrapper);
    }
}
